package com.jnr.huatu;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;

import com.jnr.huatu.activity.BarChartActivity;
import com.jnr.huatu.activity.BlurMaskFilterActivity;
import com.jnr.huatu.activity.CarouselActivity;
import com.jnr.huatu.activity.CatchExceptionLogActivity;
import com.jnr.huatu.activity.DataActivity;
import com.jnr.huatu.activity.ImgActivity;
import com.jnr.huatu.activity.LineChartActivity;
import com.jnr.huatu.activity.MPlineActivity;
import com.jnr.huatu.activity.MyView2Activity;
import com.jnr.huatu.activity.MyViewActivity;
import com.jnr.huatu.activity.PieChartActivity;
import com.jnr.huatu.activity.SearchActivity;
import com.jnr.huatu.activity.XfermodeActivity;

public class MainActivity extends AppCompatActivity implements View.OnClickListener {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        init();
    }

    private void init() {
        Button btn1 = (Button) findViewById(R.id.btn1);
        btn1.setOnClickListener(this);
        Button btn2 = (Button) findViewById(R.id.btn2);
        btn2.setOnClickListener(this);
        Button btn3 = (Button) findViewById(R.id.btn3);
        btn3.setOnClickListener(this);
        Button btn4 = (Button) findViewById(R.id.btn4);
        btn4.setOnClickListener(this);
        Button btn5 = (Button) findViewById(R.id.btn5);
        btn5.setOnClickListener(this);
        Button btn6 = (Button) findViewById(R.id.btn6);
        btn6.setOnClickListener(this);
        Button btn7 = (Button) findViewById(R.id.btn7);
        btn7.setOnClickListener(this);
        Button btn8 = (Button) findViewById(R.id.btn8);
        btn8.setOnClickListener(this);
        Button btn9 = (Button) findViewById(R.id.btn9);
        btn9.setOnClickListener(this);
        Button btn10 = (Button) findViewById(R.id.btn10);
        btn10.setOnClickListener(this);
        Button btn11 = (Button) findViewById(R.id.btn11);
        btn11.setOnClickListener(this);
        Button btn12 = (Button) findViewById(R.id.btn12);
        btn12.setOnClickListener(this);
        Button btn13 = (Button) findViewById(R.id.btn13);
        btn13.setOnClickListener(this);
    }

    @Override
    public void onClick(View view) {
        switch (view.getId()){
            case R.id.btn1:
                startActivity(new Intent(MainActivity.this, MyViewActivity.class));
                break;
            case R.id.btn2:
                startActivity(new Intent(MainActivity.this, BlurMaskFilterActivity.class));
                break;
            case R.id.btn3:
                startActivity(new Intent(MainActivity.this, XfermodeActivity.class));
                break;
            case R.id.btn4:
                startActivity(new Intent(MainActivity.this, MyView2Activity.class));
                break;
            case R.id.btn5:
                startActivity(new Intent(MainActivity.this, LineChartActivity.class));
                break;
            case R.id.btn6:
                startActivity(new Intent(MainActivity.this, BarChartActivity.class));
                break;
            case R.id.btn7:
                startActivity(new Intent(MainActivity.this, PieChartActivity.class));
                break;
            case R.id.btn8:
                startActivity(new Intent(MainActivity.this, MPlineActivity.class));
                break;
            case R.id.btn9:
                startActivity(new Intent(MainActivity.this, CatchExceptionLogActivity.class));
                break;
            case R.id.btn10:
                startActivity(new Intent(MainActivity.this, ImgActivity.class));
                break;
            case R.id.btn11:
                startActivity(new Intent(MainActivity.this, DataActivity.class));
                break;
            case R.id.btn12:
                startActivity(new Intent(MainActivity.this, CarouselActivity.class));
                break;
            case R.id.btn13:
                startActivity(new Intent(MainActivity.this, SearchActivity.class));
                break;
        }
    }
}
